package pta.test04;


public class loseDrive {
    public static void main(String[] args) {
        for (int i = 1000; i < 10000; i++) {
            if (isDigitsSame(i)&&isPerfectSquare(i)){
                System.out.println("车牌号码是"+i);
            }
        }
    }
    //判断数字相同
    public static boolean isDigitsSame(int num){
        String numStr = Integer.toString(num);
        return numStr.charAt(0)==numStr.charAt(1)
                && numStr.charAt(2)==numStr.charAt(3)
                && numStr.charAt(0)!=numStr.charAt(2);
    }
    public static boolean isPerfectSquare(int num){
        int sqrt = (int) Math.sqrt(num);
        return sqrt*sqrt==num;
    }
}
